package example.array;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by lenovo on 2016/11/4 0004.
 * 通过 List 类的 Arrays.toString () 方法和
 * List 类的 list.addAll(array1.asList(array2) 方法将两个数组合并为一个数组
 */
public class Merge {
    public static void main(String[] args) {
        String[] a = {"A", "E", "I"};
        String[] b = {"O", "U"};
        //数组转化为集合
        List<String> list = new ArrayList<>(Arrays.asList(a));
        list.addAll(Arrays.asList(b));
        //集合转化为数组
        Object[] c = list.toArray();
        System.out.println(Arrays.toString(c));

    }
}
